package org.ytor.core.sysapi.monitor.resp;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * created by yangtong on 2025/7/6 21:46:58
 * <br/>
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "实时系统监控指标")
public class RealTimeMetricsResp {

    @Schema(description = "CPU使用率（%）", example = "45.2", minimum = "0", maximum = "100")
    private Double cpuUsage;

    @Schema(description = "JVM堆内存使用率（%）", example = "68.5", minimum = "0", maximum = "100")
    private Double memoryUsage;

    @Schema(description = "物理内存使用率（%）", example = "72.1", minimum = "0", maximum = "100")
    private Double physicalMemoryUsage;

    @Schema(description = "当前线程数", example = "156")
    private Integer threadCount;

    @Schema(description = "数据库活跃连接数", example = "8")
    private Integer activeConnections;

    @Schema(description = "数据库连接池使用率（%）", example = "40.0", minimum = "0", maximum = "100")
    private Double connectionUsage;

    @Schema(description = "总GC次数", example = "1245")
    private Long totalGcCount;

    @Schema(description = "总GC耗时（毫秒）", example = "2340")
    private Long totalGcTime;

    @Schema(description = "数据采集时间戳", example = "1699123456789")
    private Long timestamp;
}
